﻿using MediatR;
using T.Personnel.Domain;
using T.Personnel.Read.API.Application.Command.EntryManageCommand;
using T.Personnel.Repository.Interface;

namespace T.Personnel.Read.API.Application.CommandHandler.EntryManageHandler
{
    public class GetEntryAllHandler : IRequestHandler<GetEntryAllCommand, List<Manage>>
    {
        private readonly IManageRepository manageRepository;

        public GetEntryAllHandler(IManageRepository manageRepository)
        {
            this.manageRepository = manageRepository;
        }

        public async Task<List<Manage>> Handle(GetEntryAllCommand request, CancellationToken cancellationToken)
        {
            return await manageRepository.GetAllEntryAsync();
        }
    }
}
